<?php

use Illuminate\Support\Facades\Route;

# 数据分析
Route::namespace('DataV')->prefix('datav')->middleware('api')->group(function ($route) {
    $route->any('order/day/get', DataVController::class.'@autoGetDayNewUserData');
    $route->any('order/list_by_date', DataVController::class.'@getDateSumList');
    $route->any('order/card', DataVController::class.'@getDashboardCardData');
    $route->any('order/list_by_province', OrderWeightDataVController::class.'@getProvinceOrderWeightSumList');
    $route->any('law/card', LawDataVController::class.'@getDashboardCardData');
    $route->any('law/list_by_date', LawDataVController::class.'@getDateSumList');

});

# 计划任务
Route::namespace('Auto')->prefix('auto')->middleware('api')->group(function ($route) {
    $route->any('document/views/inc', AutoOutServerController::class.'@viewInc');
    $route->any('event/exec', AutoAsyncEventController::class.'@execAsyncEvent');
    $route->any('event/trigger', AutoAsyncEventController::class.'@execTriggerEvent');

});

Route::namespace('Rbh')->middleware('api')->group(function () {
    # 菜单
    Route::prefix('menu')->group(function ($route) {
        $route->any('tree', MenuController::class.'@getTree');
        $route->any('save', MenuController::class.'@doSave');
        $route->any('delete', MenuController::class.'@doDelete');
    });
    # 管理员
    Route::prefix('admin')->group(function ($route) {
        $route->any('login', AdminUserController::class.'@login');
        $route->any('info', AdminUserController::class.'@info');
        $route->any('list', AdminUserController::class.'@getList');
        $route->any('save', AdminUserController::class.'@doSave');
        $route->any('delete', AdminUserController::class.'@doDelete');
        $route->any('logout', AdminUserController::class.'@logout');
    });
});
